
from PySide6.QtWidgets import QLabel

from views.base_views import SubPage

# 设置子页面
class SettingsMain(SubPage):
    def __init__(self, event_bus):
        super().__init__("设置中心", event_bus)
        self.layout.addWidget(QLabel("请选择需要设置的选项："))
        
        self.add_nav_button("账户设置", 
                          lambda: self.event_bus.switch_sub_page.emit("/settings/account"))
        self.add_nav_button("通知设置", 
                          lambda: self.event_bus.switch_sub_page.emit("/settings/notification"))
        self.add_nav_button("WiFi设置", 
                          lambda: self.event_bus.switch_sub_page.emit("/settings/wifi"))

class SettingsAccount(SubPage):
    def __init__(self, event_bus):
        super().__init__("账户设置", event_bus)
        self.layout.addWidget(QLabel("在这里可以修改您的账户信息。"))
        self.add_nav_button("返回设置中心", 
                          lambda: self.event_bus.switch_sub_page.emit("/settings/main"))

class SettingsNotification(SubPage):
    def __init__(self, event_bus):
        super().__init__("通知设置", event_bus)
        self.layout.addWidget(QLabel("在这里可以配置通知选项。"))
        self.add_nav_button("返回设置中心", 
                          lambda: self.event_bus.switch_sub_page.emit("/settings/main"))

class SettingsWiFi(SubPage):
    def __init__(self, event_bus):
        super().__init__("WiFi设置", event_bus)
        self.layout.addWidget(QLabel("在这里可以管理WiFi连接。"))
        self.add_nav_button("返回设置中心", 
                          lambda: self.event_bus.switch_sub_page.emit("/settings/main"))
